package com.digitaldreamers.framework.network;

import java.io.IOException;
import java.net.UnknownHostException;

import com.digitaldreamers.framework.network.packet.AbSendablePacket;

public interface IConnectionHandler {
	public static IConnectionHandler instance = ConnectionHandler.getInstance();
	
	public void addOnDataReceivedListener(IOnDataReceivedListener pListener);
	public void removeOnDataReceivedListener(IOnDataReceivedListener pListener);
	public void connectToServer(String pIP, int pPort) throws UnknownHostException, IOException;
	public void send (AbSendablePacket pSendablePacket) throws IOException;
	public void close();
	
	public static interface IOnDataReceivedListener {
		public void onDataReceived(byte[] pData);
	}
}
